<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>panier</title>
</head>

<body>
	<c:if test="${not empty articleAjouter}">
		<label> Articles ajouter dans le panier : </label>${articleAjouter.titre} <br />
		<br />
	</c:if>

	<table border="1">
		<tr align="center">
			<td width="200">Titre</td>
			<td width="200">Categorie</td>
			<td width="200">Prix de vente</td>
			<td width="200">Tva</td>
			<td width="400">Quantité</td>
			<td width="200">Action</td>
			<td width="200">Montant Totale</td>



			<c:forEach var="contenu" items="${panierSession.contenu}">
				<tr align="center">
					<td>${contenu.article.titre}</td>
					<td>${contenu.article.categorie.valeur}</td>
					<td>${contenu.article.tva.valeur}</td>
					<td>${contenu.article.prixVente} Euros</td>
					<td><a
						href="AfficherPanier?id=${contenu.article.id}&Action=decrementer">-</a>
						<input type="text" name="qty" size="3" value="${contenu.quantite}">
						<a
						href="AfficherPanier?id=${contenu.article.id}&Action=incrementer">+</a>
					</td>
					<td><a
						href="AfficherPanier?id=${contenu.article.id}&Action=supprimerArticlePanier">Supprimer
							du Panier</a></td>
					<td>${contenu.getMontant()}</td>
				</tr>
			</c:forEach>
			</table>

            <table>
			<section class="orderItem orderTotal">
			
				<tbody>
					<tr class="total">
						<th scope="col"><strong>Montant total :</strong> 
					</th>
						<td></td>
						<td class="amount"><strong class="currentPrice">${panierSession.getMontantTotal() }&nbsp;€ <span class="vat">TVA incluse</span>
						</strong></td>
					</tr>
				</tbody>
			
			</section>
			</table>
<!-- 		<tr> -->
<%-- 			<td>${panierSession.getMontantTotal() }</td> --%>
<!-- 		</tr> -->
	
	<br />
	<br />
	<p>
<%-- 		<label>Totale :</label> ${prixTTCPanier}  --%>
		<input type="submit" value="Ajouter d'autres articles"
			onclick="location.replace('AfficherArticle')">

		<c:choose>
			<c:when test="${not empty clientSession}">
				<input type="submit" value="Paiement"
					onclick="location.replace('Paiement')">
			</c:when>
			<c:otherwise>
				<input type="submit" value="Passer ma commande"
					onclick="location.replace('Login')">

			</c:otherwise>
		</c:choose>
</body>
</html>